// @flow
import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport';
import { TurboModuleRegistry } from 'react-native';

/// Operations on note strokes
export interface Spec extends TurboModule {
  /**
   * Save sticker - must be called after lassoing strokes, otherwise no sticker data
   * @param {string} path Path to save the sticker
   */
  saveSticker(path: string): Promise<boolean>;

  /**
   * Get sticker thumbnail dimensions
   * Returns object:
   * {
   *  width: int
   *  height: int
   * }
   * @param {string} path Sticker path
   */
  getStickerSize(path: string): Promise<Object>;

  /// Generate sticker thumbnail
  /**
   * Generate sticker thumbnail
   * @param {string} stickerPath Path to sticker
   * @param {string} thumbnailPath Path for generated thumbnail
   * @param {number} width Thumbnail width, must maintain aspect ratio with original
   * @param {number} height Thumbnail height, must maintain aspect ratio with original
   */
  generateStickerThumbnail(stickerPath: string, thumbnailPath: string, width: number, height: number): Promise<boolean>;

  /**
   * Convert image to sticker
   * @param {string} pngPath Path to image to convert, PNG only
   * @param {string} stickerPath Output path for converted sticker
   */
  convertImage2Sticker(pngPath: string, stickerPath: string): Promise<boolean>;
  /**
   * Insert sticker
   * @param {string} path Path of sticker to insert
   */
  insertSticker(path: string): Promise<Object>;
}

export default (TurboModuleRegistry.get < Spec > (
  'RNNoteTrails'
):?Spec);